package com.ruoyi.project.men.service.impl;


import com.github.pagehelper.PageInfo;
import com.ruoyi.common.utils.bootdo.PageHelperUtils;
import com.ruoyi.common.utils.bootdo.R;
import com.ruoyi.project.men.dao.MenNewDao;
import com.ruoyi.project.men.domain.MenNewDO;
import com.ruoyi.project.men.service.MenNewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class MenNewServiceImpl implements MenNewService {
	@Autowired
	private MenNewDao menNewDao;
	
	@Override
	public MenNewDO get(String id){
		return menNewDao.get(id);
	}
	
	@Override
	public List<MenNewDO> list(Map<String, Object> map){
		return menNewDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return menNewDao.count(map);
	}
	
	@Override
	public int save(MenNewDO menNew){
		return menNewDao.save(menNew);
	}
	
	@Override
	public int update(MenNewDO menNew){
		return menNewDao.update(menNew);
	}
	
	@Override
	public int remove(String id){
		return menNewDao.remove(id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return menNewDao.batchRemove(ids);
	}

    @Override
    public List<MenNewDO> likeList(Map<String, Object> map){
        return menNewDao.likeList(map);
    }
    @Override
    public int likeListCount(Map<String, Object> map){
        return menNewDao.likeListCount(map);
    }

    @Override
    public R getNewsList(Map<String, Object> params) {
		PageHelperUtils.page(params);
		List<Map<String,Object>> newsList =menNewDao.getNewsList(params);
		PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(newsList);
		return R.ok().put("data",pageInfo);
    }

}
